---
id: swagger-petstore-yaml
title: "Swagger Petstore YAML"
description: "This is a sample server Petstore server."
sidebar_label: Introduction
sidebar_position: 0
hide_title: true
custom_edit_url: null
---

import ApiLogo from "@theme/ApiLogo";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Export from "@theme/ApiDemoPanel/Export";

<span className={"theme-doc-version-badge badge badge--secondary"}>Version: 2.0.0</span>

<Export url={"https://raw.githubusercontent.com/PaloAltoNetworks/docusaurus-openapi-docs/main/demo/openAPI/petstore.yaml"} proxy={undefined}></Export>

# Swagger Petstore YAML

<ApiLogo logo={{"url":"https://redocly.github.io/redoc/petstore-logo.png","altText":"Petstore logo"}} darkLogo={undefined}></ApiLogo>

This is a sample server Petstore server.
You can find out more about Swagger at
[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).
For this sample, you can use the api key `special-key` to test the authorization filters.

## Introduction
This API is documented in **OpenAPI format** and is based on
[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).

## OpenAPI Specification
This API is documented in **OpenAPI format** and is based on
[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).

## Cross-Origin Resource Sharing
This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with  [W3C spec](https://www.w3.org/TR/cors/).
And that allows cross-domain communication from the browser.
All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.

## Authentication

Petstore offers two forms of authentication:
  - API Key
  - OAuth2
OAuth2 - an open protocol to allow secure authorization in a simple
and standard method from web, mobile and desktop applications.


<div style={{"marginBottom":"2rem"}}><h2 id={"authentication"} style={{"marginBottom":"1rem"}}>Authentication</h2><Tabs><TabItem label={"Petstore Auth"} value={"petstore_auth"}>

Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.


<div><table><tbody><tr><th>Security Scheme Type:</th><td>oauth2</td></tr><tr><th>implicit OAuth Flow:</th><td><p>Authorization URL: http://petstore.swagger.io/api/oauth/dialog</p><span>Scopes:</span><ul><li>write:pets: modify pets in your account</li><li>read:pets: read your pets</li></ul></td></tr></tbody></table></div></TabItem><TabItem label={"API Key"} value={"api_key"}>

For this sample, you can use the api key `special-key` to test the authorization filters.


<div><table><tbody><tr><th>Security Scheme Type:</th><td>apiKey</td></tr><tr><th>Header parameter name:</th><td>api_key</td></tr></tbody></table></div></TabItem></Tabs></div><div style={{"display":"flex","flexDirection":"column","marginBottom":"var(--ifm-paragraph-margin-bottom)"}}><h3 style={{"marginBottom":"0.25rem"}}>Contact</h3><span>API Support: <a href={"mailto:apiteam@swagger.io"}>apiteam@swagger.io</a></span><span>URL: <a href={"https://github.com/Redocly/redoc"}>https://github.com/Redocly/redoc</a></span></div><div style={{"marginBottom":"var(--ifm-paragraph-margin-bottom)"}}><h3 style={{"marginBottom":"0.25rem"}}>Terms of Service</h3><a href={"http://swagger.io/terms/"}>http://swagger.io/terms/</a></div><div style={{"marginBottom":"var(--ifm-paragraph-margin-bottom)"}}><h3 style={{"marginBottom":"0.25rem"}}>License</h3><a href={"http://www.apache.org/licenses/LICENSE-2.0.html"}>Apache 2.0</a></div>